﻿@page "/component"

<Header4 Divider>
    Common
</Header4>
<Grid Span="SpanSize.Is5">
    @foreach (var item in Common)
    {
        <GridColumn>
            <NavLink href="@item.Link">
                @item.Name
            </NavLink>
        </GridColumn>
    }
</Grid>
<Header4 Divider>
    Input
</Header4>
<Grid Span="SpanSize.Is5">
    @foreach (var item in Input)
    {
        <GridColumn>
            <NavLink href="@item.Link">
                @item.Name
            </NavLink>
        </GridColumn>
    }
</Grid>
<Header4 Divider>
    Layout
</Header4>
<Grid Span="SpanSize.Is5">
    @foreach (var item in Layout)
    {
        <GridColumn>
            <NavLink href="@item.Link">
                @item.Name
            </NavLink>
        </GridColumn>
    }
</Grid>
<Header4 Divider>
    Nav
</Header4>
<Grid Span="SpanSize.Is5">
    @foreach (var item in Nav)
    {
        <GridColumn>
            <NavLink href="@item.Link">
                @item.Name
            </NavLink>
        </GridColumn>
    }
</Grid>
<Header4 Divider>
    Data
</Header4>
<Grid Span="SpanSize.Is5">
    @foreach (var item in Data)
    {
        <GridColumn>
            <NavLink href="@item.Link">
                @item.Name
            </NavLink>
        </GridColumn>
    }
</Grid>
<Header4 Divider>
    Feedback
</Header4>
<Grid Span="SpanSize.Is5">
    @foreach (var item in Feedback)
    {
        <GridColumn>
            <NavLink href="@item.Link">
                @item.Name
            </NavLink>
        </GridColumn>
    }
</Grid>

@inject INavigationService NavService

@code {
    IEnumerable<Navigation> Common { get; set; }
    IEnumerable<Navigation> Input { get; set; }
    IEnumerable<Navigation> Layout { get; set; }
    IEnumerable<Navigation> Data { get; set; }
    IEnumerable<Navigation> Feedback { get; set; }
    IEnumerable<Navigation> Nav { get; set; }

    protected override void OnInitialized()
    {
        Common = NavService.GetNavigations("Common");
        Input = NavService.GetNavigations("Input");
        Layout = NavService.GetNavigations("Layout");
        Data = NavService.GetNavigations("Data");
        Feedback = NavService.GetNavigations("Feedback");
        Nav = NavService.GetNavigations("Nav");
    }
}